<?php

/**
 * Configuration file, DB connection
 *
 * @version $Id$
 * @copyright 2010
 */

// ------------------------------------------------
// Database
// ------------------------------------------------

$dbuser = "test";

$dbpassword = "test";

$dbname = "yaps";

$dbserver = "localhost";

// ------------------------------------------------
/// CONNECTION TO MYSQL DB AND DATABASE SELECTION
// ------------------------------------------------

$conn = MySQL_Connect($dbserver, $dbuser , $dbpassword);
if (!$conn):
	die("DB error in connection: ".mysql_error());
endif;

$vyberdb = MySQL_Select_DB($dbname, $conn);
if (!$vyberdb):
	die("DB selection error: ".mysql_error());
endif;

// ------------------------------------------------
// Constants
// ------------------------------------------------

$query = mysql_query("SELECT * FROM yaps_config");
while($row = mysql_fetch_array($query))
{
	$name = strtoupper($row['name']);
	define($name,$row['value']);
}

?>